package com.wnxy.consumer;

import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
import feign.Logger;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScans;

/**
 * @author yellow Docter
 * @date 2024 -04-17
 * @desc
 */
@EnableCircuitBreaker  //开启熔断器
@EnableFeignClients("com.wnxy.stu.api")
@ComponentScan(
        {"com.wnxy.stu.api", "com.wnxy.consumer"}
)
@EnableKnife4j
@SpringBootApplication
public class StuConsumerApplication {

    public static void main(String[] args) {
        SpringApplication.run(StuConsumerApplication.class,args);
    }

    /**
     *  openfeign 调用日志
     * @return
     */
    @Bean
    public Logger.Level loggerLevel(){
        return Logger.Level.FULL;
    }
}
